

(use-package lsp-copilot
  :straight '(lsp-copilot :host github :repo "jadestrong/lsp-copilot"
            :files ("lsp-copilot.el" "lsp-copilot.exe")
            :pre-build (("cargo" "build" "--release") ("cp" "./target/release/lsp-copilot.exe" "./")))
  :config
  (setq lsp-copilot-user-languages-config (expand-file-name "~/.emacs.d/languages.toml"))
  (lsp-copilot-inlay-hints-mode)
)

(defun lsp-copilot-config-after-company-box ()
(defun company-box-icons--lsp-copilot (candidate)
    (-when-let* ((copilot-item (get-text-property 0 'lsp-copilot--item candidate))
                 (lsp-item (plist-get copilot-item :item))
                 (kind-num (plist-get lsp-item :kind)))
      (alist-get kind-num company-box-icons--lsp-alist)))

(setq company-box-icons-functions
      (cons #'company-box-icons--lsp-copilot company-box-icons-functions))
)
(add-hook 'company-box-hook #'lsp-copilot-config-after-company-box)


(provide 'init-lsp-copilot)
